//
//  main.m
//  indexSetDemo
//
//  Created by zhouxiaobo on 15/10/26.
//  Copyright © 2015年 mapath. All rights reserved.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        
        NSArray *arr = @[@"one",@"two",@"three",@"four",@"five"];
        NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndexesInRange:(NSRange){2,3}];
        NSArray *arr1 = [arr objectsAtIndexes:indexSet];
        NSLog(@"%@",arr1);
        
        NSMutableIndexSet *mSet = [[NSMutableIndexSet alloc]init];
        [mSet addIndex:2];
        [mSet addIndex:4];
        NSArray *arr2 = [arr objectsAtIndexes:mSet];
        NSLog(@"%@",arr2);
        
    }
    return 0;
}
